/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.PayLogPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.IPayLogMapper;

@Service
public class PayLogService {
	@Autowired
	private IPayLogMapper payLogMapper;
	
	/**
	 * 根据ID获取PayLogPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return PayLogPo
	 */
	public PayLogPo getPayLog(int id) {
		return payLogMapper.findPayLogById(id);
	}
	
	/**
	 * 根据条件获取PayLogPo对象，并返回查询的数据总数
	 * 
	 * @param payLog
	 * @Author 迷蝶
	 * @return ResultPageTo<PayLogPo>
	 */
	public ResultPageTo<PayLogPo> getPayLogs(PayLogPo payLog) {
		return new ResultPageTo<PayLogPo>(payLog.getStart(), payLog.getSize(), 
				payLogMapper.findPayLogCount(payLog), payLogMapper.findPayLogs(payLog));
	}
	
	/**
	 * 根据ID删除PayLogPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delPayLog(int id) {
		return payLogMapper.delPayLogById(id);
	}
	
	/**
	 * 增加PayLogPo对象
	 * 
	 * @param payLog
	 * @Author 迷蝶
	 */
	public Integer addPayLog(PayLogPo payLog) {
		return payLogMapper.addPayLog(payLog);
	}
	
	/**
	 * 根据条件更新PayLogPo对象
	 * 
	 * @param payLog
	 * @Author 迷蝶
	 */
	public Integer updatePayLog(PayLogPo payLog) {
		return payLogMapper.updatePayLog(payLog);
	}
	
}
